package cn.net.cfss.fgbp.api.console.inte;

import cn.net.cfss.fgbp.api.console.constant.Constants;
import cn.net.cfss.fgbp.api.console.dto.SysRoleDto;
import cn.net.cfss.fgbp.api.console.vo.SysRoleVo;
import cn.net.cfss.fgbp.base.page.PageData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = Constants.SPI_SERVER_NAME)
@RequestMapping("role")
public interface ISysRoleService {

    @RequestMapping(value = "/add" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public boolean insert(@RequestBody SysRoleVo role);

    @RequestMapping(value = "/edit" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public boolean update(@RequestBody SysRoleVo role);

    @RequestMapping(value = "/delete/{roleId}" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public boolean delete(@PathVariable(value = "roleId") Long roleId);

    @RequestMapping(value = "/deleteBatch" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public boolean deleteBatch(@RequestBody List<Long> roleIds);

    @RequestMapping(value = "/query/{roleId}" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public SysRoleVo queryById(@PathVariable(value = "roleId") Long roleId);

    @RequestMapping(value = "/query/list" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public PageData<SysRoleDto> queryList(@RequestBody PageData<SysRoleDto> page);

    @RequestMapping(value = "/auth/query/{roleId}" ,method = RequestMethod.POST,produces="application/json;charset=UTF-8")
    public List<String> queryByRoleId(@PathVariable(value = "roleId") Long roleId);

    @RequestMapping(value = "/uniquenessCheck", method = RequestMethod.GET)
    public boolean uniquenessCheck(@RequestParam("roleCode") String roleCode,@RequestParam(value = "id",required=false) Long id);


}
